package org.budo.support.lang.util;

import java.util.Collection;

/**
 * @author lmw
 */
public class CollectionUtil {
    public static Boolean isEmpty(Collection<?> collection) {
        return null == collection || collection.isEmpty();
    }

    @SuppressWarnings("rawtypes")
    public static Integer size(Object object) {
        if (null == object) {
            return null;
        } else if (object instanceof Collection) {
            return ((Collection) object).size();
        } else {
            return -2;
        }
    }
}